package demoMod.stsconsole.monsters.exordium;

import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.monsters.AbstractMonster;
import demoMod.stsconsole.powers.SporeCloudPower;
import demoMod.stsconsole.powers.StrengthPower;

public class FungiBeast extends AbstractMonster {
    public static final String ID = "FungiBeast";

    public FungiBeast() {
        super(ID);
        this.setHp(23, 28);
        this.damage.add(new DamageInfo(6, this));
    }

    @Override
    public void usePreBattleAction() {
        applyPower(this, new SporeCloudPower(this, 2));
    }

    @Override
    protected void getMove(int aiRng) {
        if (aiRng < 60) {
            if (this.lastTwoMoves((byte)1)) {
                this.setMove(2, Intent.BUFF, monsterStrings.get(1));
            } else {
                this.setMove(1, Intent.ATTACK, this.damage.get(0));
            }
        } else if (this.lastMove(2)) {
            this.setMove(1, Intent.ATTACK, this.damage.get(0));
        } else {
            this.setMove(2, Intent.BUFF, monsterStrings.get(1));
        }
    }

    @Override
    public void takeTurn() {
        switch (this.nextMove) {
            case 1:
                this.defaultTarget.damage(this.damage.get(0));
                break;
            case 2:
                applyPower(this, new StrengthPower(this, 4));
                break;
        }
        rollMove();
    }
}
